public class OutletVisitExtension {

    public Outlet_Visit__c cc;
    public Account acc {get; set;}
    public static id accId = ApexPages.CurrentPage().getParameters().get('aid');
    public String ccId {get; set;}
    
    
    
    public List<outlet_objectives__c> objs = new List<outlet_objectives__c>();
    public String obj1 {get; set;}
    public String obj2 {get; set;}
    public String objID1 {get; set;}
    public String objID2 {get; set;}

    public OutletVisitExtension(apexPages.standardController StdController){
        cc = (Outlet_Visit__c) StdController.getrecord();
        system.debug('****************************** accid: '+accid);
        if(accId!=null){
            cc.Account__c = accId;
        }
        
        
        
        obj1 = '';
        obj2 = '';
        objID1 = '#';
        objID2 = '#';
        
        pullObjectives();
       
    }
    
    public void pullObjectives(){
        objs = [Select Name, Id, CreatedDate, Account__r.Name, Account__r.Id, Account__c From outlet_objectives__c where Account__r.Id=: cc.Account__c order by CreatedDate desc];
       
        if(objs.size()>0){
            if(objs.size()==1){
                obj1 = objs.get(0).name;
                objID1 = '/'+objs.get(0).Id;
            }else{
                obj1 = objs.get(0).name;
                objID1 = '/'+objs.get(0).Id;
                obj2 = objs.get(1).name;
                objID2 = '/'+objs.get(1).Id;
            }
        }
       
    }
    
    
}